<{extend name="Public:public0" /}>

<{block name="title"}>van: 基于vue-cil的使用<{/block}>

<{block name="sidebar"}><{include file="Public:sidebar-vuecli" /}><{/block}>

<{block name="content"}>
<div class="content guide with-sidebar components-guide">
<h1>安装 与 介绍</h1>	

<h2 id="indexjs">
	<a href="#indexjs" class="headerlink" title="indexjs" data-scroll="">@/router/index.js</a>
</h2>	
<code class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><span class="kwd">import</span><span class="pln">&nbsp;</span><span class="typ">Vue</span><span class="pln">&nbsp;</span><span class="kwd">from</span><span class="pln">&nbsp;</span><span class="str">'vue'</span></li><li class="L1"><span class="kwd">import</span><span class="pln">&nbsp;</span><span class="typ">Router</span><span class="pln">&nbsp;</span><span class="kwd">from</span><span class="pln">&nbsp;</span><span class="str">'vue-router'</span></li><li class="L2"><span class="kwd">import</span><span class="pln">&nbsp;</span><span class="typ">Home</span><span class="pln">&nbsp;</span><span class="kwd">from</span><span class="pln">&nbsp;</span><span class="str">'@/pages/home/0_Index'</span></li><li class="L3"><span class="pln">&nbsp;</span></li><li class="L4"><span class="typ">Vue</span><span class="pun">.</span><span class="kwd">use</span><span class="pun">(</span><span class="typ">Router</span><span class="pun">)</span></li><li class="L5"><span class="pln">&nbsp;</span></li><li class="L6"><span class="kwd">export</span><span class="pln">&nbsp;</span><span class="kwd">default</span><span class="pln">&nbsp;</span><span class="kwd">new</span><span class="pln">&nbsp;</span><span class="typ">Router</span><span class="pun">({</span></li><li class="L7"><span class="pln">&nbsp;&nbsp;routes</span><span class="pun">:</span><span class="pln">&nbsp;</span><span class="pun">[</span></li><li class="L8"><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="pun">{</span></li><li class="L9"><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path</span><span class="pun">:</span><span class="pln">&nbsp;</span><span class="str">'/'</span><span class="pun">,</span></li><li class="L0"><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name</span><span class="pun">:</span><span class="pln">&nbsp;</span><span class="str">'Home2'</span><span class="pun">,</span><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="com">//&nbsp;组件使用时名称,&nbsp;如{{&nbsp;$route.name&nbsp;}}&nbsp;===&nbsp;'Home2',&nbsp;一般这里和下面的组件名称一致, 使用Home</span></li><li class="L1"><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;component</span><span class="pun">:</span><span class="pln">&nbsp;</span><span class="typ">Home</span><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="com">//&nbsp;需要调用的组件的名称&nbsp;也就是0_Index中的&nbsp;Home组件</span></li><li class="L2"><span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="pun">}</span></li><li class="L3"><span class="pln">&nbsp;&nbsp;</span><span class="pun">]</span></li><li class="L4"><span class="pun">})</span></li></ol></code>






<br><br>


	
</div>
<{/block}>
